home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / fplib20 / specs < prev    next >
Text File  |  1990-11-23  |  2KB  |  55 lines

  1. FPLIB implements the set of routines described in K&R, Second Edition,
  2. pp 250-251.  In the following descriptions, x and y are of type float,
  3. and n is of type int.  All functions (including ceil and floor) return
  4. a value of type float.
  5.  
  6. Remember to declare any routine you use, either explicitly or by
  7. including MATH.H.  If you don't, the compiler will assume the function
  8. returns a value of type int, and will perform an unwanted conversion.
  9.  
  10. A domain error occurs if an argument is outside the range for which
  11. the function is defined (e.g. sqrt(-1.0)).  In this case, errno is
  12. set to EDOM and the result is usually 0.0.  A range error occurs if
  13. the result cannot be represented as a float (e.g. exp(100.0)).  In
  14. this case, errno is set to ERANGE and the result is HUGE_VAL.  If the
  15. function succeeds, errno is not zeroed.
  16.  
  17. In all trigonometric functions, angles are expressed in radians.  Pi
  18. radians equal 180 degrees.
  19.  
  20. All routines work in all three resolutions :-)
  21.  
  22. sin(x)        sine of x.
  23. cos(x)        cosine of x.
  24. tan(x)        tangent of x.
  25. asin(x)        inverse sine of x in the range -pi/2 to pi/2.
  26. acos(x)        inverse cosine of x in the range 0 to pi.
  27. atan(x)        inverse tangent of x in the range -pi/2 to pi/2.
  28. atan2(x,y)    inverse tangent of x/y in the range -pi to pi.  The
  29.         angle is chosen so that x has the sign of the sine and
  30.         y has the sign of the cosine.
  31. sinh(x)        hyperbolic sine of x.
  32. cosh(x)        hyperbolic cosine of x.
  33. tanh(x)        hyperbolic tangent of x.
  34. exp(x)        e to the power of x.
  35. log(x)        logarithm, base e, of x: x > 0.
  36. log10(x)    logarithm, base 10, of x: x > 0.
  37. pow(x,y)    x to the yth power.  A domain error occurs if x=0 and
  38.         y<=0, or if x<0 and y is not an integer.
  39. sqrt(x)        square root of x: x>=0.
  40. ceil(x)        smallest whole number not less than x.
  41. floor(x)    largest whole number not greater than x.
  42. fabs(x)        absolute value of x.
  43. ldexp(x,n)    x, times 2 to the nth power.
  44. frexp(x,pn)    splits x into a fraction between 0.5 and 0.999..., which
  45.         is the returned value, and a power of 2, which is stored
  46.         in the int pointed to by pn.  If x is 0, both parts of
  47.         the result are 0.
  48. modf(x,py)    splits x into integral and fractional parts, both with
  49.         the same sign as x.  The fraction is returned and the
  50.         integral part is stored in the float pointed to by py.
  51. fmod(x,y)    remainder of x/y, with the same sign as y.
  52. atof(ps)    converts the string ps into a float.
  53.  
  54. The file MATH.H also defines several mathematical constants.
  55.